home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-04 | 2.6 KB | 106 lines | [TEXT/KAHL] |
- /***************************************************** IMPLEMENTATION
- DATE: 10/21/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPYentaAboutBox
-
- SUPERCLASS: CPPWindow
-
- This C++ class manages the Yenta about box dialog
-
- ********************************************************************/
-
- #include "CPPYentaAboutBox.h"
- #include <CPPWindowManager.h>
- #include <CPPButton.h>
- #include <CPPStaticText.h>
- #include <ToolboxTools.h>
-
- #define prefsWindowID 202
-
- extern CPPWindowManager *gWindowManager;
- extern void DoStdOKButton (CPPWindow *theWindow);
- extern void DoStdCancelButton (CPPWindow *theWindow);
-
- Rect AboutRect = {42,20, 158, 262};
-
- /*-----------------------------------------------------------------*/
- /*------------------------ PUBLIC METHODS -------------------------*/
- /*-----------------------------------------------------------------*/
-
- CPPYentaAboutBox::CPPYentaAboutBox (CPPWindowManager *theManager) :
- CPPWindow (theManager, &AboutRect, "\pAbout", TRUE,
- altDBoxProc, FALSE, 13, TRUE, FALSE, systemFont, 12)
- {
- GrafPtr SavePort;
- Rect tempRect;
-
- GetPort(&SavePort);
- SetPort(this->theWindow);
-
- // create static text item
- SetRect (&tempRect, 10, 10, 232, 65);
- aboutText = new CPPStaticText ((CPPWindow *)this, &tempRect,
- "\pYenta v1.0\rwritten by Eric Rosé\rusing the Appletalk Class Library",
- systemFont, 12, teJustCenter);
-
- // create the dialog buttons
- SetRect (&tempRect, 79, 84, 159, 104);
- okButton = new CPPButton ((CPPWindow *)this, &tempRect, "\pOK", TRUE);
- okButton->SetDoClickProc (DoStdOKButton);
-
- SetPort(SavePort);
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPYentaAboutBox::~CPPYentaAboutBox ()
- {
-
- }
-
- /*-----------------------------------------------------------------*/
-
- char *CPPYentaAboutBox::ClassName (void)
- {
- return "CPPPrefsWindow";
- }
-
- /*-----------------------------------------------------------------*/
-
- Boolean CPPYentaAboutBox::DoUserKey (EventRecord *theEvent)
- {
- char theKey;
- CPPList *TempList;
-
- theKey = theEvent->message & charCodeMask;
- switch (theKey) {
- case kEnter :
- case kReturn :
- if (okButton)
- okButton->SimulateClick();
- default:
- return TRUE;
- break;
- } // switch
-
- }
-
- /*-----------------------------------------------------------------*/
-
- Boolean DoAboutBox (void)
- {
- CPPYentaAboutBox *theWindow;
- Boolean theResult;
-
- theWindow = new CPPYentaAboutBox (gWindowManager);
-
- if (theWindow)
- {
- theWindow->DoModalWindow ();
- delete theWindow;
- return theResult;
- }
- else
- SysBeep(1);
- }